#include<stdio.h>

int main()
{
    int a,n,nowNum,sumNum=0;
    scanf("a=%d,n=%d",&a,&n);
    for(int i=1;i<=n;i++){
        nowNum=0;
        for(int j=0;j<i;j++)
        {
            printf("%d",a);
            nowNum=nowNum*10+a;
        }
        printf("\n");
        sumNum=sumNum+nowNum;
    }
    printf("sum=%d",sumNum);
}